<template>
	<view class="box" :style="{'padding-top':systemHeight+28+'px'}">
		<view class="head">
			<image class="back" src="/static/img/back.png" @click="back()"></image>
			<view class="title">Promotion</view>
			<view class="right"></view>
		</view>
		<image class="bg" src="/static/img/bg_2.png"></image>
		<view class="rules" @click="rule()">Promotion Rules</view>


		<view class="bottom">
			<view class="code">
				<image class="twoCode" src=""></image>
				<view class="code_right">
					<view>My promotional code</view>
					<view class="invite_code">652412
						<image class="copy" src="/static/img/copy.png"></image>
					</view>
					<view class="small_buttono">Promote now</view>
				</view>
			</view>
			<view class="promotion">
				<view class="small_title">My Promotion</view>
				<view class="nums">
					<view class="small_box">
						<view>24</view>
						<view class="small_box_line">
							<view class="small_box_title">Number</view>
							<image class="next" src="/static/img/right.png"></image>
						</view>
					</view>
					<view class="line"></view>
					<view class="small_box">
						<view>24</view>
						<view class="small_box_line"> 
							<view class="small_box_title">Number</view>
							<image class="next" src="/static/img/right.png"></image>
						</view>
					</view>
				</view>
				<view class="small_title">Promotion List</view>
				<view class="row">
					<image class="avatar" src="/static/img/bg.png"></image>
					<view>
						<view class="nikcname">John Wilson</view>
						<view class="time">2025-04-23</view>
					</view>
					<view class="add_nums">+ MK200</view>
				</view>
			</view>
		</view>

		<view class="more" @click="more">
			More
			<image class="next" src="/static/img/right.png"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				systemHeight: null
			}
		},
		created() {
			this.systemHeight = uni.getSystemInfoSync().statusBarHeight
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			rule() {
				uni.navigateTo({
					url: "/pages/promotion/rules"
				})
			},
			more(){
				uni.navigateTo({
					url:"/pages/promotion/myPromotion"
				})
			}
		}
	}
</script>

<style>
	.box {
		position: fixed;
		width: 100%;
		height: 100vh;
	}

	.head {
		width: 92%;
		margin: 0rpx auto;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-family: Mont;
		font-weight: bold;
		font-size: 32rpx;
	}

	.back {
		width: 18rpx;
		height: 30rpx;
	}

	.right {
		width: 18rpx;
	}

	.bg {
		z-index: -1;
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
	}

	.rules {
		position: absolute;
		top: 163rpx;
		right: 0;
		width: 210rpx;
		height: 60rpx;
		background: #000000;
		border-radius: 30rpx 0rpx 0rpx 30rpx;
		opacity: 0.52;
		font-family: Mont;
		font-weight: bold;
		font-size: 22rpx;
		color: #FFFFFF;
		line-height: 60rpx;
		text-align: center;
	}

	.bottom {
		position: absolute;
		bottom: 190rpx;
		left: 50%;
		transform: translate(-50%, 0);
		width: 92%;
	}

	.code {
		padding: 21rpx;
		display: flex;
		align-items: center;
		background: #FFFFFF;
		border-radius: 19rpx;
		font-family: Mont;
		font-weight: 500;
		font-size: 28rpx;
		margin-bottom: 20rpx;
	}

	.twoCode {
		border: 1rpx solid;
		width: 179rpx;
		height: 179rpx;
		margin-right: 16rpx;
	}

	.code_right {
		display: flex;
		height: 100%;
		flex-direction: column;
		justify-content: space-between;
	}

	.invite_code {
		margin: 18rpx 0rpx 18rpx;
		display: flex;
		align-items: center;
		font-family: Mont;
		font-weight: bold;
		font-size: 40rpx;
	}

	.copy {
		margin-left: 20rpx;
		width: 30rpx;
		height: 32rpx;
	}

	.small_buttono {
		width: 262rpx;
		height: 62rpx;
		background: linear-gradient(181deg, #59C491 0%, #8ECF95 100%);
		border-radius: 20rpx;
		border: 2px solid #4EA87B;
		font-family: Mont;
		font-weight: bold;
		font-size: 28rpx;
		color: #FFFFFF;
		line-height: 62rpx;
		text-shadow: 0rpx 2rpx 0rpx rgba(37, 128, 85, 0.39);
		text-align: center;
	}

	.promotion {
		padding-top: 35rpx;
		height: 685rpx;
		background: #FFFFFF;
		border-radius: 33rpx;
		border: 5px solid #FFFFFF;

		font-family: Mont;
		font-weight: bold;
		font-size: 32rpx;
		color: #000000;
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.small_title{
		margin: 38rpx 0rpx 35rpx;
	}
	.nums {
		margin: 54rpx 0rpx 33rpx;
		border-bottom: 1rpx #E7E7E7;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	.small_box{
		display: flex;
		flex-direction: column;
		align-items: center;
	}
	.small_box_line{
		display: flex;
		align-items: center;
	}
	.line{
		width: 1rpx;
		height: 50rpx;
		background: #A6A6A6;
		margin: 0rpx 93rpx;
	}
	.small_box_title {
		font-family: Mont;
		font-weight: 500;
		font-size: 28rpx;
		color: #4C4C4C;
	}

	.next {
		width: 8rpx;
		height: 14rpx;
		margin-left: 10rpx;
	}

	.row {
		position: relative;
		display: flex;
		width: 92%;
		font-family: Mont;
		font-weight: 500;
		font-size: 28rpx;
	}

	.avatar {
		width: 76rpx;
		height: 76rpx;
		border-radius: 50%;
		margin-right: 20rpx;
	}

	.time {
		margin-top: 10rpx;
		font-family: Mont;
		font-weight: 500;
		font-size: 24rpx;
	}

	.add_nums {
		top: 50%;
		right: 0;
		transform: translate(0, -50%);
		position: absolute;
		font-family: Mont;
		font-weight: bold;
		font-size: 24rpx;
	}

	.more {
		position: absolute;
		bottom: 200rpx;
		left: 50%;
		transform: translate(-50%, 0);
		display: flex;
		align-items: center;
		font-family: Mont;
		font-weight: 500;
		font-size: 28rpx;
		color: #4C4C4C;
	}
</style>